<?php
/**
 * @package Green Realty component
 * @copyright (C) 2012 Greenkey studio. All rights reserved
 * @license GNU/GPL Version 2 - http://www.gnu.org/licenses/gpl-2.0.html
 * @author Greenkey studio
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import Joomla controller library
jimport('joomla.application.component.controller');

/**
 * General Controller of Green Realty component
 */
class GRealtyController extends JController
{
	/**
	 * display task
	 *
	 * @return void
	 */
	function display($cachable = false)
	{
		// set default view if not set
		//$input = JFactory::getApplication()->input;
		//$controller->execute($input->getCmd('task'));
		//$input->set('view', $input->getCmd('view', 'Green Realty administrator - default line'));
        // The same construction
        // JRequest::getCmd('task')
        JRequest::setVar('view', JRequest::getCmd('view', 'GRmain'));

		// call parent behavior
		parent::display($cachable);

        // Set the submenu
		GRealtyHelper::addSubmenu('messages');
	}
}

?>
